<title><#if BankPager??>编辑<#else>新增</#if>银行卡</title>

<div class="page-header">
	<h1>
		<#if BankPager??>编辑<#else>新增</#if>银行卡
		<small>
			<i class="icon-double-angle-right"></i>
		</small>
	</h1>
</div>
<form class="form-horizontal" role="form" id="validation-form" method="POST" action="${ctx}/admin/bank/dosave${suffix}" enctype="multipart/form-data">
<#if BankPager??>
	<input type="hidden" name="id" value="${BankPager.id}"/>
</#if>
<div class="form-group">
	<label class="control-label col-xs-12 col-sm-3 no-padding-right" for="name">银行名称:</label>
	<div class="col-xs-12 col-sm-9">
		<div class="clearfix">
			<span class="block input-icon width-20">
					
					<#if BankPager??>
						<input type="text" name="name" value="${BankPager.name}" class="form-control" placeholder=""/>
					<#else>
						<input type="text" name="name" value="" class="form-control" placeholder=""/>
					</#if>
			</span>
		</div>
	</div>
</div>
<div class="form-group">
	<label class="control-label col-xs-12 col-sm-3 no-padding-right" for="coverPath">图标:</label>
	<div class="col-xs-12 col-sm-9">
		<div class="clearfix">
			<div class="ace-file-input width-40">
			<#if BankPager??>
				<input type="file" name="coverPath" id="id-input-file-1" value="${BankPager.image!}">
			<#else>
				<input type="file" name="coverPath" id="id-input-file-1" value="">
			</#if>
			</div>
		</div>
	</div>
</div>

<div class="form-group" style="margin-top:40px">
	<label class="control-label col-xs-12 col-sm-3 no-padding-right">类型:</label>
	<div class="col-xs-12 col-sm-9">
		<div class="clearfix">
		<#assign slideshowTypes=dicSetting.getParameterMap("bank.type") />
		<@ace.formSingleSelect options=slideshowTypes checkValue=(BankPager.type)!-1 name="type" listKey="key" listValue="value"/>
		</div>
	</div>
</div>
<div class="form-group">
	<div class="col-md-offset-3 col-md-9">
		<button class="btn btn-info" type="submit"><i class="icon-ok bigger-110"></i>提  交</button>
		&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;
		<button class="btn" type="reset"><i class="icon-undo bigger-110"></i>重  置</button>
	</div>
</div>

</fieldset>
</form>
<#if errorMsg??>
	<div class="hr hr-18 hr-double dotted"></div>
	<h4 class="lighter">
		<i class="icon-hand-right icon-animated-hand-pointer red"></i>
		<span class="pink">${errorMsg}
		</span>
	</h4>
</#if>
<script>
var country = Object.create(B.Country);
$(document).ready(function(){
	RP.addBreadcrumb([{name:"基础"}, {name:"<#if BankPager??>编辑<#else>新增</#if>银行卡",  active: true}]);
	$('#id-input-file-1').ace_file_input({
		no_file:'没文件 ...',
		btn_choose:'请选择文件',
		btn_change:'重新选择文件',
		droppable:false,
		onchange:null,
		thumbnail:false
	});
	$('#validation-form').validate({
		errorElement: 'div',
		errorClass: 'help-block',
		focusInvalid: true,
		rules: {
		name: {
				required: true,
				maxlength:16,
				minlength:4
			},
		cardNo: {
				required: true,
				number:true,
				maxlength:19,
				minlength:19
			},
		type: {
				required: true
			}
		},
	
		messages: {
			"filed":"请输入消息标题",
			"filed":"请输入消息内容"
		},
	
		invalidHandler: function (event, validator) { //display error alert on form submit   
			RP.Form.invalidHandler(event, validator);
		},
	
		highlight: function (e) {
			RP.Form.highlight(e);
		},
		
		errorPlacement: function (error, element) {
			RP.Form.errorPlacement(error, element);	
		},
	
		success: function (e) {
			RP.Form.success(e);	
		},
		
		submitHandler: function(form) {
			RP.Form.submitHandler(form);
		}
	});
});
$(function (){
	<#if BankPager??>
		var o ="${BankPager.image!}";
		var dt = $(".file-name").attr("data-title");
		$(".file-name").attr("data-title",o);
		$(".file-label").attr("data-title","重新选择文件");
	<#else>
	
	</#if>
})
</script>
